home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
MELL
/
NETLIB00
/
NetLib
/
c
/
network
< prev
next >
Wrap
Text File
|
1995-02-28
|
304b
|
17 lines
#include "arpa/inet.h"
#include "netinet/in.h"
#include "sys/byteorder.h"
/*
* Extract a network number in host byte order from a string
*/
u_long inet_network(const char *cp)
{
struct in_addr net;
/* Decode the address string */
net.s_addr = inet_addr(cp);
return ntohl(inet_netof(net));
}